Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_RCTelemetry: Fix Baro and Vario values #28478

Merged
merged 1 commit into from
Nov 5, 2024
Merged

Conversation

Frank0587
Copy link
Contributor

Add the missing byte swapping for 16bit values

@peterbarker
Copy link
Contributor

@andyp1per this is pretty recent code - has to be one or the other, how did you test the original code?

@andyp1per
Copy link
Collaborator

@andyp1per this is pretty recent code - has to be one or the other, how did you test the original code?

It requires the TX to specifically understand the encoding, so it was tested with great difficulty by others. I'm quite prepared to believe the encoding is still wrong, but would need to see evidence of success in order to approve

@Frank0587
Copy link
Contributor Author

I had used the original code on my plane and got always about -586,5m instead of 0 as altitude. As I calculate the values back to hex and look at the formula used at elrs and opentx, i found the wrong byteorder. Compare the code in AP between baro and vario against other telemetry values, i found the missing byte swapping. I test the new code on my plane, and the telemetry values looks now like expected.

@andyp1per
Copy link
Collaborator

@Frank0587 you need to squash your commits

Add the missing byte swapping for 16bit values
Copy link
Collaborator

@andyp1per andyp1per left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tridge tridge merged commit 3aa2f51 into ArduPilot:master Nov 5, 2024
98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Pending
Development

Successfully merging this pull request may close these issues.

5 participants